<template>
  <div class="home">
    <button @click="gotodetail">跳转详情页</button>
    <add />
    <ul>
      <li v-for="(item, index) in $store.state.list" :key="index">
        {{ item.title }}
      </li>
    </ul>
  </div>
</template>

<script>
// @ is an alias to /src
import add from "../components/Add.vue";

export default {
  data() {
    return {
      id: 1001,
    };
  },
  methods: {
    gotodetail() {
      this.$router.push({ path: "/detail/" + this.id });
    },
  },
  components: {
    add,
  },
};
</script>
